/**
 * Created by IntelliJ IDEA.
 * User: mstine
 * Date: Mar 20, 2008
 * Time: 3:26:07 PM
 * To change this template use File | Settings | File Templates.
 */
def e = new Expando()

println "${e.class}\n"

println "${e.properties}\n"

println "${e.class.methods.name}\n"

//So, what's it good for?

//well, expandos "EXPAND" to support any fields you need
e.latitude = 70
e.longitude = 30
println "${e}\n"

//what about methods?
//just add closures

e.areWeLost = {->
    return (e.longitude != 30) || (e.latitude != 70)
}

println "are we lost? ${e.areWeLost()}\n"

e.latitude = 12
println "are we lost? ${e.areWeLost()}\n"

e.goNorth = { howMuch ->
    e.latitude += howMuch
}

println "latitude: ${e.latitude}\n"

e.goNorth(20)
println "latitude: ${e.latitude}\n"

//GOTO: categories.groovy
